// This file is licensed under the Elastic License 2.0. Copyright 2021 StarRocks Limited.

#include <gtest/gtest.h>

#include "exprs/vectorized/decimal_cast_expr_test_helper.h"
#include "runtime/primitive_type.h"
#include "runtime/vectorized/time_types.h"
namespace starrocks::vectorized {
class VectorizedDecimalCastExprTimeTest : public ::testing::Test {
public:
    void SetUp() { date::init_date_cache(); }
};
TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDateToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "1998-10-20", 9, 0, "19981020", "false"}, {-1, -1, "1971-06-02", 9, 0, "19710602", "false"},
            {-1, -1, "1986-08-29", 9, 0, "19860829", "false"}, {-1, -1, "1972-04-16", 9, 0, "19720416", "false"},
            {-1, -1, "2000-07-11", 9, 0, "20000711", "false"}, {-1, -1, "1990-11-12", 9, 0, "19901112", "false"},
            {-1, -1, "1984-12-25", 9, 0, "19841225", "false"}, {-1, -1, "2001-09-01", 9, 0, "20010901", "false"},
            {-1, -1, "1988-09-07", 9, 0, "19880907", "false"}, {-1, -1, "1970-02-21", 9, 0, "19700221", "false"},
            {-1, -1, "1976-03-07", 9, 0, "19760307", "false"}, {-1, -1, "1978-12-22", 9, 0, "19781222", "false"},
            {-1, -1, "1974-09-07", 9, 0, "19740907", "false"}, {-1, -1, "1997-06-27", 9, 0, "19970627", "false"},
            {-1, -1, "1974-08-04", 9, 0, "19740804", "false"}, {-1, -1, "1994-08-17", 9, 0, "19940817", "false"},
            {-1, -1, "1981-08-07", 9, 0, "19810807", "false"}, {-1, -1, "1988-12-29", 9, 0, "19881229", "false"},
            {-1, -1, "1995-01-10", 9, 0, "19950110", "false"}, {-1, -1, "1990-09-08", 9, 0, "19900908", "false"}};
    test_cast_all<TYPE_DATE, TYPE_DECIMAL32>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDateToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "1989-06-19", 9, 2, "19890619", "false"}, {-1, -1, "1995-03-24", 9, 2, "19950324", "false"},
            {-1, -1, "1987-04-10", 9, 2, "19870410", "false"}, {-1, -1, "1995-03-13", 9, 2, "19950313", "false"},
            {-1, -1, "1994-02-21", 9, 2, "19940221", "false"}, {-1, -1, "1975-06-03", 9, 2, "19750603", "false"},
            {-1, -1, "1992-10-21", 9, 2, "19921021", "false"}, {-1, -1, "1984-03-07", 9, 2, "19840307", "false"},
            {-1, -1, "1986-11-14", 9, 2, "19861114", "false"}, {-1, -1, "1972-03-16", 9, 2, "19720316", "false"},
            {-1, -1, "1996-03-29", 9, 2, "19960329", "false"}, {-1, -1, "1981-07-19", 9, 2, "19810719", "false"},
            {-1, -1, "1974-04-21", 9, 2, "19740421", "false"}, {-1, -1, "1977-05-12", 9, 2, "19770512", "false"},
            {-1, -1, "2001-03-02", 9, 2, "20010302", "false"}, {-1, -1, "2000-06-18", 9, 2, "20000618", "false"},
            {-1, -1, "1999-01-21", 9, 2, "19990121", "false"}, {-1, -1, "2001-05-07", 9, 2, "20010507", "false"},
            {-1, -1, "1986-10-19", 9, 2, "19861019", "false"}, {-1, -1, "1982-05-11", 9, 2, "19820511", "false"}};
    test_cast_all<TYPE_DATE, TYPE_DECIMAL32>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDateToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "1984-01-11", 9, 9, "", "true"}, {-1, -1, "1986-06-08", 9, 9, "", "true"},
                                    {-1, -1, "1990-08-05", 9, 9, "", "true"}, {-1, -1, "1996-03-21", 9, 9, "", "true"},
                                    {-1, -1, "1970-11-26", 9, 9, "", "true"}, {-1, -1, "1987-09-20", 9, 9, "", "true"},
                                    {-1, -1, "1972-05-02", 9, 9, "", "true"}, {-1, -1, "1997-12-24", 9, 9, "", "true"},
                                    {-1, -1, "1978-03-26", 9, 9, "", "true"}, {-1, -1, "1993-07-02", 9, 9, "", "true"},
                                    {-1, -1, "1995-04-12", 9, 9, "", "true"}, {-1, -1, "1992-01-27", 9, 9, "", "true"},
                                    {-1, -1, "1982-07-04", 9, 9, "", "true"}, {-1, -1, "1999-06-05", 9, 9, "", "true"},
                                    {-1, -1, "1976-07-15", 9, 9, "", "true"}, {-1, -1, "1998-06-30", 9, 9, "", "true"},
                                    {-1, -1, "1977-11-22", 9, 9, "", "true"}, {-1, -1, "1989-02-28", 9, 9, "", "true"},
                                    {-1, -1, "1978-04-15", 9, 9, "", "true"}, {-1, -1, "1971-12-27", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_DATE, TYPE_DECIMAL32>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDateToDecimal32p7s4Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "1976-08-09", 7, 4, "", "true"}, {-1, -1, "1999-03-20", 7, 4, "", "true"},
                                    {-1, -1, "1995-04-20", 7, 4, "", "true"}, {-1, -1, "1979-08-13", 7, 4, "", "true"},
                                    {-1, -1, "1998-10-09", 7, 4, "", "true"}, {-1, -1, "1988-07-20", 7, 4, "", "true"},
                                    {-1, -1, "1989-09-05", 7, 4, "", "true"}, {-1, -1, "1990-12-24", 7, 4, "", "true"},
                                    {-1, -1, "1990-05-26", 7, 4, "", "true"}, {-1, -1, "1972-12-30", 7, 4, "", "true"},
                                    {-1, -1, "1982-05-10", 7, 4, "", "true"}, {-1, -1, "1999-07-15", 7, 4, "", "true"},
                                    {-1, -1, "1980-03-14", 7, 4, "", "true"}, {-1, -1, "1979-12-01", 7, 4, "", "true"},
                                    {-1, -1, "1993-07-24", 7, 4, "", "true"}, {-1, -1, "1970-10-24", 7, 4, "", "true"},
                                    {-1, -1, "1992-07-29", 7, 4, "", "true"}, {-1, -1, "1983-06-26", 7, 4, "", "true"},
                                    {-1, -1, "1970-05-18", 7, 4, "", "true"}, {-1, -1, "1984-04-14", 7, 4, "", "true"}};
    test_cast_all_fail<TYPE_DATE, TYPE_DECIMAL32>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDateToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "1973-01-24", 18, 0, "19730124", "false"}, {-1, -1, "1982-01-27", 18, 0, "19820127", "false"},
            {-1, -1, "1987-02-27", 18, 0, "19870227", "false"}, {-1, -1, "1988-07-05", 18, 0, "19880705", "false"},
            {-1, -1, "1971-02-15", 18, 0, "19710215", "false"}, {-1, -1, "1990-08-22", 18, 0, "19900822", "false"},
            {-1, -1, "1990-06-20", 18, 0, "19900620", "false"}, {-1, -1, "1979-11-28", 18, 0, "19791128", "false"},
            {-1, -1, "1976-04-23", 18, 0, "19760423", "false"}, {-1, -1, "1977-07-24", 18, 0, "19770724", "false"},
            {-1, -1, "1995-07-19", 18, 0, "19950719", "false"}, {-1, -1, "1977-04-29", 18, 0, "19770429", "false"},
            {-1, -1, "1993-03-06", 18, 0, "19930306", "false"}, {-1, -1, "1994-10-24", 18, 0, "19941024", "false"},
            {-1, -1, "1989-05-16", 18, 0, "19890516", "false"}, {-1, -1, "1994-12-17", 18, 0, "19941217", "false"},
            {-1, -1, "1971-02-24", 18, 0, "19710224", "false"}, {-1, -1, "1990-10-19", 18, 0, "19901019", "false"},
            {-1, -1, "1983-05-07", 18, 0, "19830507", "false"}, {-1, -1, "1990-06-28", 18, 0, "19900628", "false"}};
    test_cast_all<TYPE_DATE, TYPE_DECIMAL64>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDateToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "1993-03-23", 18, 2, "19930323", "false"}, {-1, -1, "1996-08-16", 18, 2, "19960816", "false"},
            {-1, -1, "1979-08-21", 18, 2, "19790821", "false"}, {-1, -1, "1994-02-13", 18, 2, "19940213", "false"},
            {-1, -1, "1988-12-18", 18, 2, "19881218", "false"}, {-1, -1, "1989-08-06", 18, 2, "19890806", "false"},
            {-1, -1, "1972-05-21", 18, 2, "19720521", "false"}, {-1, -1, "1971-03-27", 18, 2, "19710327", "false"},
            {-1, -1, "1971-11-06", 18, 2, "19711106", "false"}, {-1, -1, "1999-12-25", 18, 2, "19991225", "false"},
            {-1, -1, "1993-08-29", 18, 2, "19930829", "false"}, {-1, -1, "1985-08-29", 18, 2, "19850829", "false"},
            {-1, -1, "1995-06-20", 18, 2, "19950620", "false"}, {-1, -1, "1998-06-04", 18, 2, "19980604", "false"},
            {-1, -1, "1984-07-25", 18, 2, "19840725", "false"}, {-1, -1, "1970-10-29", 18, 2, "19701029", "false"},
            {-1, -1, "1985-03-29", 18, 2, "19850329", "false"}, {-1, -1, "1990-06-03", 18, 2, "19900603", "false"},
            {-1, -1, "2001-12-04", 18, 2, "20011204", "false"}, {-1, -1, "1997-07-06", 18, 2, "19970706", "false"}};
    test_cast_all<TYPE_DATE, TYPE_DECIMAL64>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDateToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "1983-11-18", 18, 9, "19831118", "false"}, {-1, -1, "1970-09-20", 18, 9, "19700920", "false"},
            {-1, -1, "1991-11-21", 18, 9, "19911121", "false"}, {-1, -1, "2000-06-15", 18, 9, "20000615", "false"},
            {-1, -1, "1987-09-02", 18, 9, "19870902", "false"}, {-1, -1, "1994-02-14", 18, 9, "19940214", "false"},
            {-1, -1, "1970-01-13", 18, 9, "19700113", "false"}, {-1, -1, "1976-04-08", 18, 9, "19760408", "false"},
            {-1, -1, "1996-02-10", 18, 9, "19960210", "false"}, {-1, -1, "1998-03-30", 18, 9, "19980330", "false"},
            {-1, -1, "1975-01-19", 18, 9, "19750119", "false"}, {-1, -1, "2001-05-02", 18, 9, "20010502", "false"},
            {-1, -1, "1991-05-03", 18, 9, "19910503", "false"}, {-1, -1, "1996-08-05", 18, 9, "19960805", "false"},
            {-1, -1, "1986-04-01", 18, 9, "19860401", "false"}, {-1, -1, "1970-12-01", 18, 9, "19701201", "false"},
            {-1, -1, "1976-06-20", 18, 9, "19760620", "false"}, {-1, -1, "1978-05-07", 18, 9, "19780507", "false"},
            {-1, -1, "1977-01-01", 18, 9, "19770101", "false"}, {-1, -1, "1997-12-17", 18, 9, "19971217", "false"}};
    test_cast_all<TYPE_DATE, TYPE_DECIMAL64>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDateToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "1979-03-30", 18, 18, "", "true"}, {-1, -1, "1979-02-01", 18, 18, "", "true"},
            {-1, -1, "1970-08-25", 18, 18, "", "true"}, {-1, -1, "1982-12-04", 18, 18, "", "true"},
            {-1, -1, "1994-10-21", 18, 18, "", "true"}, {-1, -1, "1972-08-14", 18, 18, "", "true"},
            {-1, -1, "1983-12-12", 18, 18, "", "true"}, {-1, -1, "1973-06-29", 18, 18, "", "true"},
            {-1, -1, "1986-05-26", 18, 18, "", "true"}, {-1, -1, "1973-11-15", 18, 18, "", "true"},
            {-1, -1, "1973-09-07", 18, 18, "", "true"}, {-1, -1, "1983-04-02", 18, 18, "", "true"},
            {-1, -1, "1998-12-26", 18, 18, "", "true"}, {-1, -1, "1989-12-18", 18, 18, "", "true"},
            {-1, -1, "1996-07-08", 18, 18, "", "true"}, {-1, -1, "1981-12-25", 18, 18, "", "true"},
            {-1, -1, "1974-11-12", 18, 18, "", "true"}, {-1, -1, "1984-10-24", 18, 18, "", "true"},
            {-1, -1, "1970-06-06", 18, 18, "", "true"}, {-1, -1, "1998-06-10", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_DATE, TYPE_DECIMAL64>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDateToDecimal64p15s13Abnormal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "1986-07-27", 15, 13, "", "true"}, {-1, -1, "2000-01-08", 15, 13, "", "true"},
            {-1, -1, "1993-05-01", 15, 13, "", "true"}, {-1, -1, "1994-07-15", 15, 13, "", "true"},
            {-1, -1, "1990-05-12", 15, 13, "", "true"}, {-1, -1, "1991-03-25", 15, 13, "", "true"},
            {-1, -1, "1984-08-14", 15, 13, "", "true"}, {-1, -1, "1973-02-03", 15, 13, "", "true"},
            {-1, -1, "1977-01-18", 15, 13, "", "true"}, {-1, -1, "1998-05-22", 15, 13, "", "true"},
            {-1, -1, "1985-08-01", 15, 13, "", "true"}, {-1, -1, "1995-05-31", 15, 13, "", "true"},
            {-1, -1, "1995-04-30", 15, 13, "", "true"}, {-1, -1, "1993-10-25", 15, 13, "", "true"},
            {-1, -1, "1985-12-17", 15, 13, "", "true"}, {-1, -1, "1995-05-14", 15, 13, "", "true"},
            {-1, -1, "2001-04-22", 15, 13, "", "true"}, {-1, -1, "1976-08-21", 15, 13, "", "true"},
            {-1, -1, "1993-03-27", 15, 13, "", "true"}, {-1, -1, "1974-11-25", 15, 13, "", "true"}};
    test_cast_all_fail<TYPE_DATE, TYPE_DECIMAL64>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDateToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "1979-06-30", 38, 0, "19790630", "false"}, {-1, -1, "1988-11-22", 38, 0, "19881122", "false"},
            {-1, -1, "1987-08-09", 38, 0, "19870809", "false"}, {-1, -1, "1989-06-18", 38, 0, "19890618", "false"},
            {-1, -1, "1990-04-01", 38, 0, "19900401", "false"}, {-1, -1, "1985-03-11", 38, 0, "19850311", "false"},
            {-1, -1, "1973-07-29", 38, 0, "19730729", "false"}, {-1, -1, "1978-12-01", 38, 0, "19781201", "false"},
            {-1, -1, "1976-01-21", 38, 0, "19760121", "false"}, {-1, -1, "1990-05-09", 38, 0, "19900509", "false"},
            {-1, -1, "2001-11-15", 38, 0, "20011115", "false"}, {-1, -1, "1992-02-05", 38, 0, "19920205", "false"},
            {-1, -1, "1998-05-13", 38, 0, "19980513", "false"}, {-1, -1, "1973-04-07", 38, 0, "19730407", "false"},
            {-1, -1, "1991-09-07", 38, 0, "19910907", "false"}, {-1, -1, "1989-08-10", 38, 0, "19890810", "false"},
            {-1, -1, "1990-02-15", 38, 0, "19900215", "false"}, {-1, -1, "1973-12-03", 38, 0, "19731203", "false"},
            {-1, -1, "1994-02-03", 38, 0, "19940203", "false"}, {-1, -1, "1978-01-25", 38, 0, "19780125", "false"}};
    test_cast_all<TYPE_DATE, TYPE_DECIMAL128>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDateToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "1985-05-04", 38, 2, "19850504", "false"}, {-1, -1, "1975-10-05", 38, 2, "19751005", "false"},
            {-1, -1, "1988-12-12", 38, 2, "19881212", "false"}, {-1, -1, "1997-03-30", 38, 2, "19970330", "false"},
            {-1, -1, "2001-10-07", 38, 2, "20011007", "false"}, {-1, -1, "1984-08-14", 38, 2, "19840814", "false"},
            {-1, -1, "1997-08-21", 38, 2, "19970821", "false"}, {-1, -1, "1971-09-20", 38, 2, "19710920", "false"},
            {-1, -1, "1971-10-03", 38, 2, "19711003", "false"}, {-1, -1, "1984-05-05", 38, 2, "19840505", "false"},
            {-1, -1, "1983-08-08", 38, 2, "19830808", "false"}, {-1, -1, "1998-10-22", 38, 2, "19981022", "false"},
            {-1, -1, "1971-09-16", 38, 2, "19710916", "false"}, {-1, -1, "1983-11-28", 38, 2, "19831128", "false"},
            {-1, -1, "1985-11-28", 38, 2, "19851128", "false"}, {-1, -1, "1975-01-11", 38, 2, "19750111", "false"},
            {-1, -1, "1974-06-16", 38, 2, "19740616", "false"}, {-1, -1, "1995-09-19", 38, 2, "19950919", "false"},
            {-1, -1, "1985-11-06", 38, 2, "19851106", "false"}, {-1, -1, "1987-06-07", 38, 2, "19870607", "false"}};
    test_cast_all<TYPE_DATE, TYPE_DECIMAL128>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDateToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "2001-03-09", 38, 9, "20010309", "false"}, {-1, -1, "1999-04-16", 38, 9, "19990416", "false"},
            {-1, -1, "1985-04-17", 38, 9, "19850417", "false"}, {-1, -1, "1971-04-11", 38, 9, "19710411", "false"},
            {-1, -1, "1994-04-24", 38, 9, "19940424", "false"}, {-1, -1, "1979-10-29", 38, 9, "19791029", "false"},
            {-1, -1, "2000-02-05", 38, 9, "20000205", "false"}, {-1, -1, "1977-12-11", 38, 9, "19771211", "false"},
            {-1, -1, "1984-10-19", 38, 9, "19841019", "false"}, {-1, -1, "1997-03-08", 38, 9, "19970308", "false"},
            {-1, -1, "1970-08-26", 38, 9, "19700826", "false"}, {-1, -1, "1989-08-27", 38, 9, "19890827", "false"},
            {-1, -1, "1972-11-16", 38, 9, "19721116", "false"}, {-1, -1, "1994-05-06", 38, 9, "19940506", "false"},
            {-1, -1, "1994-12-22", 38, 9, "19941222", "false"}, {-1, -1, "1989-07-09", 38, 9, "19890709", "false"},
            {-1, -1, "2000-01-17", 38, 9, "20000117", "false"}, {-1, -1, "1995-02-28", 38, 9, "19950228", "false"},
            {-1, -1, "1981-04-24", 38, 9, "19810424", "false"}, {-1, -1, "1994-07-20", 38, 9, "19940720", "false"}};
    test_cast_all<TYPE_DATE, TYPE_DECIMAL128>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDateToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "1996-10-18", 38, 13, "19961018", "false"}, {-1, -1, "1976-01-08", 38, 13, "19760108", "false"},
            {-1, -1, "1995-12-26", 38, 13, "19951226", "false"}, {-1, -1, "2000-07-12", 38, 13, "20000712", "false"},
            {-1, -1, "1973-11-07", 38, 13, "19731107", "false"}, {-1, -1, "1974-10-22", 38, 13, "19741022", "false"},
            {-1, -1, "1999-10-27", 38, 13, "19991027", "false"}, {-1, -1, "1980-02-20", 38, 13, "19800220", "false"},
            {-1, -1, "1993-03-05", 38, 13, "19930305", "false"}, {-1, -1, "1983-07-03", 38, 13, "19830703", "false"},
            {-1, -1, "1987-08-16", 38, 13, "19870816", "false"}, {-1, -1, "1984-03-14", 38, 13, "19840314", "false"},
            {-1, -1, "1985-09-09", 38, 13, "19850909", "false"}, {-1, -1, "1976-03-21", 38, 13, "19760321", "false"},
            {-1, -1, "1977-09-26", 38, 13, "19770926", "false"}, {-1, -1, "1986-11-11", 38, 13, "19861111", "false"},
            {-1, -1, "1986-12-12", 38, 13, "19861212", "false"}, {-1, -1, "1973-03-11", 38, 13, "19730311", "false"},
            {-1, -1, "1980-06-08", 38, 13, "19800608", "false"}, {-1, -1, "1998-08-25", 38, 13, "19980825", "false"}};
    test_cast_all<TYPE_DATE, TYPE_DECIMAL128>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDateToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "1977-12-12", 38, 18, "19771212", "false"}, {-1, -1, "1996-08-27", 38, 18, "19960827", "false"},
            {-1, -1, "1991-02-11", 38, 18, "19910211", "false"}, {-1, -1, "1998-06-27", 38, 18, "19980627", "false"},
            {-1, -1, "1998-10-26", 38, 18, "19981026", "false"}, {-1, -1, "1981-01-28", 38, 18, "19810128", "false"},
            {-1, -1, "1974-01-06", 38, 18, "19740106", "false"}, {-1, -1, "1984-08-23", 38, 18, "19840823", "false"},
            {-1, -1, "1979-02-06", 38, 18, "19790206", "false"}, {-1, -1, "1971-10-12", 38, 18, "19711012", "false"},
            {-1, -1, "1986-09-07", 38, 18, "19860907", "false"}, {-1, -1, "2000-03-08", 38, 18, "20000308", "false"},
            {-1, -1, "1973-07-09", 38, 18, "19730709", "false"}, {-1, -1, "1970-10-17", 38, 18, "19701017", "false"},
            {-1, -1, "1980-01-17", 38, 18, "19800117", "false"}, {-1, -1, "1992-03-03", 38, 18, "19920303", "false"},
            {-1, -1, "1976-04-18", 38, 18, "19760418", "false"}, {-1, -1, "1998-04-28", 38, 18, "19980428", "false"},
            {-1, -1, "1981-06-03", 38, 18, "19810603", "false"}, {-1, -1, "1992-01-13", 38, 18, "19920113", "false"}};
    test_cast_all<TYPE_DATE, TYPE_DECIMAL128>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDateToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {
            {-1, -1, "1984-01-20", 35, 30, "19840120", "false"}, {-1, -1, "1987-06-17", 35, 30, "19870617", "false"},
            {-1, -1, "1979-11-02", 35, 30, "19791102", "false"}, {-1, -1, "2000-04-21", 35, 30, "20000421", "false"},
            {-1, -1, "1986-01-10", 35, 30, "19860110", "false"}, {-1, -1, "1970-07-05", 35, 30, "19700705", "false"},
            {-1, -1, "1976-11-06", 35, 30, "19761106", "false"}, {-1, -1, "1974-02-25", 35, 30, "19740225", "false"},
            {-1, -1, "1980-07-20", 35, 30, "19800720", "false"}, {-1, -1, "1991-06-14", 35, 30, "19910614", "false"},
            {-1, -1, "1996-11-13", 35, 30, "19961113", "false"}, {-1, -1, "1978-11-24", 35, 30, "19781124", "false"},
            {-1, -1, "1999-11-06", 35, 30, "19991106", "false"}, {-1, -1, "1994-08-18", 35, 30, "19940818", "false"},
            {-1, -1, "2001-06-06", 35, 30, "20010606", "false"}, {-1, -1, "1993-09-22", 35, 30, "19930922", "false"},
            {-1, -1, "1993-01-01", 35, 30, "19930101", "false"}, {-1, -1, "1985-06-29", 35, 30, "19850629", "false"},
            {-1, -1, "1999-02-17", 35, 30, "19990217", "false"}, {-1, -1, "1975-11-07", 35, 30, "19751107", "false"}};
    test_cast_all<TYPE_DATE, TYPE_DECIMAL128>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDatetimeToDecimal32p9s0Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "2007-09-17 06:23:13.226", 9, 0, "", "true"},
                                    {-1, -1, "2004-02-22 03:10:22.457", 9, 0, "", "true"},
                                    {-1, -1, "2005-01-06 05:58:06.01", 9, 0, "", "true"},
                                    {-1, -1, "2016-11-25 00:29:46.062", 9, 0, "", "true"},
                                    {-1, -1, "2018-01-13 19:23:48.063", 9, 0, "", "true"},
                                    {-1, -1, "2011-08-07 03:04:05.33", 9, 0, "", "true"},
                                    {-1, -1, "2005-12-09 18:11:57.153", 9, 0, "", "true"},
                                    {-1, -1, "2012-10-16 20:12:07.972", 9, 0, "", "true"},
                                    {-1, -1, "2002-11-15 05:54:48.851", 9, 0, "", "true"},
                                    {-1, -1, "2003-03-18 13:19:18.299", 9, 0, "", "true"},
                                    {-1, -1, "2014-09-04 12:52:21.893", 9, 0, "", "true"},
                                    {-1, -1, "2016-12-10 07:15:35.393", 9, 0, "", "true"},
                                    {-1, -1, "2006-07-08 19:50:49.027", 9, 0, "", "true"},
                                    {-1, -1, "2013-03-22 07:57:10.198", 9, 0, "", "true"},
                                    {-1, -1, "2014-08-17 23:19:03.222", 9, 0, "", "true"},
                                    {-1, -1, "2001-11-06 12:50:02.033", 9, 0, "", "true"},
                                    {-1, -1, "2004-04-07 18:45:53.102", 9, 0, "", "true"},
                                    {-1, -1, "2004-11-24 02:10:26.615", 9, 0, "", "true"},
                                    {-1, -1, "2005-04-05 09:09:04.91", 9, 0, "", "true"},
                                    {-1, -1, "2008-11-09 06:28:54.221", 9, 0, "", "true"}};
    test_cast_all_fail<TYPE_DATETIME, TYPE_DECIMAL32>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDatetimeToDecimal32p9s2Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "2008-07-01 03:43:27.607", 9, 2, "", "true"},
                                    {-1, -1, "2017-06-21 23:30:58.094", 9, 2, "", "true"},
                                    {-1, -1, "2019-05-22 08:57:09.761", 9, 2, "", "true"},
                                    {-1, -1, "2010-04-19 13:01:50.795", 9, 2, "", "true"},
                                    {-1, -1, "2015-07-30 00:02:53.954", 9, 2, "", "true"},
                                    {-1, -1, "2009-07-26 18:14:18.239", 9, 2, "", "true"},
                                    {-1, -1, "2019-07-26 22:42:46.931", 9, 2, "", "true"},
                                    {-1, -1, "2009-08-17 18:02:00.17", 9, 2, "", "true"},
                                    {-1, -1, "2009-11-05 03:45:12.711", 9, 2, "", "true"},
                                    {-1, -1, "2021-03-04 15:40:11.035", 9, 2, "", "true"},
                                    {-1, -1, "2013-11-25 21:30:56.222", 9, 2, "", "true"},
                                    {-1, -1, "2001-03-24 11:49:29.934", 9, 2, "", "true"},
                                    {-1, -1, "2014-07-04 04:07:49.158", 9, 2, "", "true"},
                                    {-1, -1, "2012-08-03 06:05:55.986", 9, 2, "", "true"},
                                    {-1, -1, "2018-06-02 16:48:07.056", 9, 2, "", "true"},
                                    {-1, -1, "2015-05-27 15:52:03.457", 9, 2, "", "true"},
                                    {-1, -1, "2006-09-27 02:24:06.081", 9, 2, "", "true"},
                                    {-1, -1, "2001-02-16 09:21:18.663", 9, 2, "", "true"},
                                    {-1, -1, "2003-03-04 09:36:37.654", 9, 2, "", "true"},
                                    {-1, -1, "2021-07-27 17:36:25.261", 9, 2, "", "true"}};
    test_cast_all_fail<TYPE_DATETIME, TYPE_DECIMAL32>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDatetimeToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "2009-05-19 12:52:44.693", 9, 9, "", "true"},
                                    {-1, -1, "2015-02-20 21:51:30.381", 9, 9, "", "true"},
                                    {-1, -1, "2016-03-26 06:34:56.318", 9, 9, "", "true"},
                                    {-1, -1, "2018-01-17 22:00:14.188", 9, 9, "", "true"},
                                    {-1, -1, "2011-07-10 05:24:52.914", 9, 9, "", "true"},
                                    {-1, -1, "2011-10-06 16:43:39.01", 9, 9, "", "true"},
                                    {-1, -1, "2011-05-27 13:36:09.601", 9, 9, "", "true"},
                                    {-1, -1, "2003-04-25 13:54:00.247", 9, 9, "", "true"},
                                    {-1, -1, "2001-09-28 04:26:33.094", 9, 9, "", "true"},
                                    {-1, -1, "2010-02-26 03:33:06.491", 9, 9, "", "true"},
                                    {-1, -1, "2013-07-05 19:03:40.838", 9, 9, "", "true"},
                                    {-1, -1, "2017-10-01 16:29:26.508", 9, 9, "", "true"},
                                    {-1, -1, "2004-04-29 17:21:02.426", 9, 9, "", "true"},
                                    {-1, -1, "2003-05-11 23:52:10.229", 9, 9, "", "true"},
                                    {-1, -1, "2015-10-10 10:34:43.01", 9, 9, "", "true"},
                                    {-1, -1, "2018-03-30 19:36:07.315", 9, 9, "", "true"},
                                    {-1, -1, "2001-08-18 03:10:44.929", 9, 9, "", "true"},
                                    {-1, -1, "2005-08-22 15:45:00.07", 9, 9, "", "true"},
                                    {-1, -1, "2016-08-03 21:06:37.062", 9, 9, "", "true"},
                                    {-1, -1, "2010-01-04 01:50:24.124", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_DATETIME, TYPE_DECIMAL32>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDatetimeToDecimal32p7s4Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "2010-10-25 15:58:33.899", 7, 4, "", "true"},
                                    {-1, -1, "2015-09-14 11:40:27.095", 7, 4, "", "true"},
                                    {-1, -1, "2015-01-07 10:30:49.208", 7, 4, "", "true"},
                                    {-1, -1, "2011-02-27 07:28:09.54", 7, 4, "", "true"},
                                    {-1, -1, "2001-10-29 18:38:51.369", 7, 4, "", "true"},
                                    {-1, -1, "2005-09-26 21:51:32.251", 7, 4, "", "true"},
                                    {-1, -1, "2004-06-05 09:31:43.418", 7, 4, "", "true"},
                                    {-1, -1, "2015-05-15 21:42:13.164", 7, 4, "", "true"},
                                    {-1, -1, "2018-11-20 06:17:09.875", 7, 4, "", "true"},
                                    {-1, -1, "2020-07-29 04:53:23.312", 7, 4, "", "true"},
                                    {-1, -1, "2021-06-06 00:20:41.614", 7, 4, "", "true"},
                                    {-1, -1, "2004-10-08 19:45:03.005", 7, 4, "", "true"},
                                    {-1, -1, "2010-06-08 08:18:18.985", 7, 4, "", "true"},
                                    {-1, -1, "2003-08-12 08:24:20.253", 7, 4, "", "true"},
                                    {-1, -1, "2019-07-07 15:39:15.236", 7, 4, "", "true"},
                                    {-1, -1, "2011-08-27 18:20:48.911", 7, 4, "", "true"},
                                    {-1, -1, "2011-10-13 20:16:30.758", 7, 4, "", "true"},
                                    {-1, -1, "2016-09-30 07:38:57.078", 7, 4, "", "true"},
                                    {-1, -1, "2013-02-17 06:10:37.349", 7, 4, "", "true"},
                                    {-1, -1, "2008-05-12 08:27:05.421", 7, 4, "", "true"}};
    test_cast_all_fail<TYPE_DATETIME, TYPE_DECIMAL32>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDatetimeToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "2007-03-16 09:56:30.948", 18, 0, "20070316095630", "false"},
                                    {-1, -1, "2015-05-01 20:51:13.014", 18, 0, "20150501205113", "false"},
                                    {-1, -1, "2004-01-14 11:23:04.884", 18, 0, "20040114112304", "false"},
                                    {-1, -1, "2010-12-12 20:29:42.798", 18, 0, "20101212202942", "false"},
                                    {-1, -1, "2001-03-24 19:09:48.706", 18, 0, "20010324190948", "false"},
                                    {-1, -1, "2020-09-05 11:41:12.079", 18, 0, "20200905114112", "false"},
                                    {-1, -1, "2009-08-29 10:52:16.415", 18, 0, "20090829105216", "false"},
                                    {-1, -1, "2020-04-24 03:44:20.965", 18, 0, "20200424034420", "false"},
                                    {-1, -1, "2018-11-09 14:17:15.253", 18, 0, "20181109141715", "false"},
                                    {-1, -1, "2007-02-27 06:25:52.806", 18, 0, "20070227062552", "false"},
                                    {-1, -1, "2018-02-20 12:39:04.103", 18, 0, "20180220123904", "false"},
                                    {-1, -1, "2002-01-14 07:52:04.902", 18, 0, "20020114075204", "false"},
                                    {-1, -1, "2013-11-03 13:12:56.615", 18, 0, "20131103131256", "false"},
                                    {-1, -1, "2018-07-17 12:11:23.346", 18, 0, "20180717121123", "false"},
                                    {-1, -1, "2020-04-13 19:04:27.68", 18, 0, "20200413190427", "false"},
                                    {-1, -1, "2010-05-05 09:13:26.358", 18, 0, "20100505091326", "false"},
                                    {-1, -1, "2010-04-14 11:42:58.121", 18, 0, "20100414114258", "false"},
                                    {-1, -1, "2004-04-25 05:39:56.576", 18, 0, "20040425053956", "false"},
                                    {-1, -1, "2003-06-26 21:56:03.334", 18, 0, "20030626215603", "false"},
                                    {-1, -1, "2021-06-18 21:15:41.326", 18, 0, "20210618211541", "false"}};
    test_cast_all<TYPE_DATETIME, TYPE_DECIMAL64>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDatetimeToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "2006-11-13 08:29:13.598", 18, 2, "20061113082913", "false"},
                                    {-1, -1, "2016-02-23 23:41:57.65", 18, 2, "20160223234157", "false"},
                                    {-1, -1, "2008-02-27 23:44:59.913", 18, 2, "20080227234459", "false"},
                                    {-1, -1, "2017-03-09 17:09:56.844", 18, 2, "20170309170956", "false"},
                                    {-1, -1, "2020-02-26 16:26:46.989", 18, 2, "20200226162646", "false"},
                                    {-1, -1, "2001-12-04 12:54:15.707", 18, 2, "20011204125415", "false"},
                                    {-1, -1, "2002-11-21 16:30:10.027", 18, 2, "20021121163010", "false"},
                                    {-1, -1, "2005-07-02 18:11:02.928", 18, 2, "20050702181102", "false"},
                                    {-1, -1, "2007-03-14 12:15:00.613", 18, 2, "20070314121500", "false"},
                                    {-1, -1, "2017-02-25 20:18:57.883", 18, 2, "20170225201857", "false"},
                                    {-1, -1, "2006-05-28 23:46:23.361", 18, 2, "20060528234623", "false"},
                                    {-1, -1, "2002-10-31 07:26:15.092", 18, 2, "20021031072615", "false"},
                                    {-1, -1, "2020-01-02 18:00:52.015", 18, 2, "20200102180052", "false"},
                                    {-1, -1, "2013-02-25 01:04:10.635", 18, 2, "20130225010410", "false"},
                                    {-1, -1, "2017-02-02 08:16:38.538", 18, 2, "20170202081638", "false"},
                                    {-1, -1, "2010-08-07 04:14:34.585", 18, 2, "20100807041434", "false"},
                                    {-1, -1, "2008-02-18 02:37:15.936", 18, 2, "20080218023715", "false"},
                                    {-1, -1, "2021-01-28 03:22:57.567", 18, 2, "20210128032257", "false"},
                                    {-1, -1, "2004-05-15 22:10:01.756", 18, 2, "20040515221001", "false"},
                                    {-1, -1, "2007-12-28 11:08:10.021", 18, 2, "20071228110810", "false"}};
    test_cast_all<TYPE_DATETIME, TYPE_DECIMAL64>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDatetimeToDecimal64p18s9Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "2004-09-12 05:53:22.854", 18, 9, "", "true"},
                                    {-1, -1, "2016-01-11 18:45:26.565", 18, 9, "", "true"},
                                    {-1, -1, "2004-12-18 23:56:22.951", 18, 9, "", "true"},
                                    {-1, -1, "2008-09-17 22:14:19.176", 18, 9, "", "true"},
                                    {-1, -1, "2001-06-25 17:56:03.523", 18, 9, "", "true"},
                                    {-1, -1, "2020-09-03 11:06:03.69", 18, 9, "", "true"},
                                    {-1, -1, "2020-11-04 06:38:46.619", 18, 9, "", "true"},
                                    {-1, -1, "2003-09-02 09:22:43.009", 18, 9, "", "true"},
                                    {-1, -1, "2017-01-10 01:51:57.565", 18, 9, "", "true"},
                                    {-1, -1, "2017-12-20 20:59:47.807", 18, 9, "", "true"},
                                    {-1, -1, "2017-08-29 23:20:17.136", 18, 9, "", "true"},
                                    {-1, -1, "2003-06-02 04:15:16.633", 18, 9, "", "true"},
                                    {-1, -1, "2013-04-20 14:45:07.488", 18, 9, "", "true"},
                                    {-1, -1, "2021-07-20 14:25:56.897", 18, 9, "", "true"},
                                    {-1, -1, "2015-03-21 13:07:58.535", 18, 9, "", "true"},
                                    {-1, -1, "2004-07-22 01:38:12.261", 18, 9, "", "true"},
                                    {-1, -1, "2021-06-02 19:32:48.387", 18, 9, "", "true"},
                                    {-1, -1, "2021-11-10 11:25:37.3", 18, 9, "", "true"},
                                    {-1, -1, "2001-12-19 18:12:19.544", 18, 9, "", "true"},
                                    {-1, -1, "2014-05-22 02:58:29.977", 18, 9, "", "true"}};
    test_cast_all_fail<TYPE_DATETIME, TYPE_DECIMAL64>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDatetimeToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "2014-09-21 10:22:48.79", 18, 18, "", "true"},
                                    {-1, -1, "2007-12-18 17:47:30.959", 18, 18, "", "true"},
                                    {-1, -1, "2017-06-22 09:18:15.371", 18, 18, "", "true"},
                                    {-1, -1, "2003-04-11 13:52:47.915", 18, 18, "", "true"},
                                    {-1, -1, "2006-09-08 17:06:57.563", 18, 18, "", "true"},
                                    {-1, -1, "2007-03-14 07:10:26.499", 18, 18, "", "true"},
                                    {-1, -1, "2008-07-25 04:37:52.722", 18, 18, "", "true"},
                                    {-1, -1, "2008-06-12 21:42:13.26", 18, 18, "", "true"},
                                    {-1, -1, "2006-12-12 20:43:06.773", 18, 18, "", "true"},
                                    {-1, -1, "2012-10-27 15:56:45.946", 18, 18, "", "true"},
                                    {-1, -1, "2014-07-27 22:37:00.363", 18, 18, "", "true"},
                                    {-1, -1, "2011-02-21 10:59:29.134", 18, 18, "", "true"},
                                    {-1, -1, "2012-06-25 02:46:09.103", 18, 18, "", "true"},
                                    {-1, -1, "2004-02-04 03:31:33.912", 18, 18, "", "true"},
                                    {-1, -1, "2009-03-24 02:47:34.832", 18, 18, "", "true"},
                                    {-1, -1, "2004-10-09 20:03:52.124", 18, 18, "", "true"},
                                    {-1, -1, "2010-10-04 07:19:50.356", 18, 18, "", "true"},
                                    {-1, -1, "2009-01-05 18:03:52.586", 18, 18, "", "true"},
                                    {-1, -1, "2014-05-07 13:02:53.928", 18, 18, "", "true"},
                                    {-1, -1, "2009-12-24 12:30:14.345", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_DATETIME, TYPE_DECIMAL64>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDatetimeToDecimal64p15s13Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "2016-05-18 14:04:41.358", 15, 13, "", "true"},
                                    {-1, -1, "2007-11-21 00:48:57.376", 15, 13, "", "true"},
                                    {-1, -1, "2014-12-01 16:27:07.974", 15, 13, "", "true"},
                                    {-1, -1, "2021-11-18 02:00:23.415", 15, 13, "", "true"},
                                    {-1, -1, "2006-05-07 09:48:40.344", 15, 13, "", "true"},
                                    {-1, -1, "2009-09-10 06:57:40.887", 15, 13, "", "true"},
                                    {-1, -1, "2020-04-22 23:40:25.479", 15, 13, "", "true"},
                                    {-1, -1, "2010-06-28 22:21:09.928", 15, 13, "", "true"},
                                    {-1, -1, "2002-07-27 06:27:03.862", 15, 13, "", "true"},
                                    {-1, -1, "2016-01-21 17:51:48.016", 15, 13, "", "true"},
                                    {-1, -1, "2016-06-04 16:43:22.794", 15, 13, "", "true"},
                                    {-1, -1, "2020-10-02 10:41:02.295", 15, 13, "", "true"},
                                    {-1, -1, "2004-03-18 19:23:02.185", 15, 13, "", "true"},
                                    {-1, -1, "2009-07-09 03:28:47.028", 15, 13, "", "true"},
                                    {-1, -1, "2005-10-22 21:27:57.366", 15, 13, "", "true"},
                                    {-1, -1, "2001-09-11 00:59:47.34", 15, 13, "", "true"},
                                    {-1, -1, "2009-08-08 17:09:12.344", 15, 13, "", "true"},
                                    {-1, -1, "2003-10-12 03:51:29.314", 15, 13, "", "true"},
                                    {-1, -1, "2013-07-08 00:04:47.387", 15, 13, "", "true"},
                                    {-1, -1, "2021-12-29 08:09:16.568", 15, 13, "", "true"}};
    test_cast_all_fail<TYPE_DATETIME, TYPE_DECIMAL64>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDatetimeToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "2001-10-27 22:20:52.161", 38, 0, "20011027222052", "false"},
                                    {-1, -1, "2005-08-07 23:31:53.12", 38, 0, "20050807233153", "false"},
                                    {-1, -1, "2002-12-25 01:51:44.364", 38, 0, "20021225015144", "false"},
                                    {-1, -1, "2004-09-24 05:12:52.153", 38, 0, "20040924051252", "false"},
                                    {-1, -1, "2016-07-01 01:07:54.568", 38, 0, "20160701010754", "false"},
                                    {-1, -1, "2002-03-08 19:19:45.986", 38, 0, "20020308191945", "false"},
                                    {-1, -1, "2010-07-26 01:21:06.125", 38, 0, "20100726012106", "false"},
                                    {-1, -1, "2014-03-03 07:17:35.16", 38, 0, "20140303071735", "false"},
                                    {-1, -1, "2018-03-28 22:25:30.933", 38, 0, "20180328222530", "false"},
                                    {-1, -1, "2019-09-26 18:46:50.511", 38, 0, "20190926184650", "false"},
                                    {-1, -1, "2017-03-13 10:13:57.495", 38, 0, "20170313101357", "false"},
                                    {-1, -1, "2003-01-05 15:03:34.142", 38, 0, "20030105150334", "false"},
                                    {-1, -1, "2014-05-19 20:47:47.224", 38, 0, "20140519204747", "false"},
                                    {-1, -1, "2003-06-06 04:11:51.781", 38, 0, "20030606041151", "false"},
                                    {-1, -1, "2017-05-26 05:43:31.398", 38, 0, "20170526054331", "false"},
                                    {-1, -1, "2006-03-14 23:44:14.847", 38, 0, "20060314234414", "false"},
                                    {-1, -1, "2008-03-17 09:22:51.608", 38, 0, "20080317092251", "false"},
                                    {-1, -1, "2008-02-09 04:15:37.851", 38, 0, "20080209041537", "false"},
                                    {-1, -1, "2001-03-10 05:08:57.354", 38, 0, "20010310050857", "false"},
                                    {-1, -1, "2014-07-28 11:51:26.443", 38, 0, "20140728115126", "false"}};
    test_cast_all<TYPE_DATETIME, TYPE_DECIMAL128>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDatetimeToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "2008-12-14 08:46:35.619", 38, 2, "20081214084635", "false"},
                                    {-1, -1, "2005-08-09 13:10:12.488", 38, 2, "20050809131012", "false"},
                                    {-1, -1, "2009-07-20 21:32:17.697", 38, 2, "20090720213217", "false"},
                                    {-1, -1, "2012-10-19 05:49:02.271", 38, 2, "20121019054902", "false"},
                                    {-1, -1, "2014-03-01 16:04:26.166", 38, 2, "20140301160426", "false"},
                                    {-1, -1, "2015-08-06 02:30:07.532", 38, 2, "20150806023007", "false"},
                                    {-1, -1, "2019-04-02 21:52:46.268", 38, 2, "20190402215246", "false"},
                                    {-1, -1, "2015-06-03 03:29:57.171", 38, 2, "20150603032957", "false"},
                                    {-1, -1, "2006-04-14 21:12:05.289", 38, 2, "20060414211205", "false"},
                                    {-1, -1, "2009-11-13 09:23:06.084", 38, 2, "20091113092306", "false"},
                                    {-1, -1, "2021-10-15 20:30:50.37", 38, 2, "20211015203050", "false"},
                                    {-1, -1, "2015-06-14 01:05:09.293", 38, 2, "20150614010509", "false"},
                                    {-1, -1, "2006-04-21 22:55:52.092", 38, 2, "20060421225552", "false"},
                                    {-1, -1, "2021-10-27 13:03:40.049", 38, 2, "20211027130340", "false"},
                                    {-1, -1, "2008-07-07 02:02:48.577", 38, 2, "20080707020248", "false"},
                                    {-1, -1, "2012-05-05 14:57:21.468", 38, 2, "20120505145721", "false"},
                                    {-1, -1, "2010-03-07 19:41:24.303", 38, 2, "20100307194124", "false"},
                                    {-1, -1, "2014-03-28 23:06:58.601", 38, 2, "20140328230658", "false"},
                                    {-1, -1, "2001-05-31 11:48:48.242", 38, 2, "20010531114848", "false"},
                                    {-1, -1, "2015-01-18 21:03:10.907", 38, 2, "20150118210310", "false"}};
    test_cast_all<TYPE_DATETIME, TYPE_DECIMAL128>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDatetimeToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "2016-09-09 19:42:11.05", 38, 9, "20160909194211", "false"},
                                    {-1, -1, "2008-07-10 19:59:45.401", 38, 9, "20080710195945", "false"},
                                    {-1, -1, "2002-10-16 09:09:08.484", 38, 9, "20021016090908", "false"},
                                    {-1, -1, "2002-03-24 06:24:04.18", 38, 9, "20020324062404", "false"},
                                    {-1, -1, "2010-02-27 07:44:39.521", 38, 9, "20100227074439", "false"},
                                    {-1, -1, "2011-12-23 01:10:50.541", 38, 9, "20111223011050", "false"},
                                    {-1, -1, "2005-09-24 12:55:01.199", 38, 9, "20050924125501", "false"},
                                    {-1, -1, "2014-05-31 23:05:20.835", 38, 9, "20140531230520", "false"},
                                    {-1, -1, "2003-02-20 07:15:27.218", 38, 9, "20030220071527", "false"},
                                    {-1, -1, "2019-09-23 11:10:32.246", 38, 9, "20190923111032", "false"},
                                    {-1, -1, "2014-06-19 02:10:05.2", 38, 9, "20140619021005", "false"},
                                    {-1, -1, "2004-07-29 06:52:30.622", 38, 9, "20040729065230", "false"},
                                    {-1, -1, "2002-02-25 11:40:09.716", 38, 9, "20020225114009", "false"},
                                    {-1, -1, "2013-01-18 23:28:24.237", 38, 9, "20130118232824", "false"},
                                    {-1, -1, "2015-07-08 04:59:30.301", 38, 9, "20150708045930", "false"},
                                    {-1, -1, "2006-12-11 16:49:02.431", 38, 9, "20061211164902", "false"},
                                    {-1, -1, "2020-05-26 16:14:28.803", 38, 9, "20200526161428", "false"},
                                    {-1, -1, "2012-10-12 08:25:22.128", 38, 9, "20121012082522", "false"},
                                    {-1, -1, "2006-08-24 05:01:12.16", 38, 9, "20060824050112", "false"},
                                    {-1, -1, "2012-08-26 23:41:29.481", 38, 9, "20120826234129", "false"}};
    test_cast_all<TYPE_DATETIME, TYPE_DECIMAL128>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDatetimeToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "2009-09-12 22:19:00.007", 38, 13, "20090912221900", "false"},
                                    {-1, -1, "2016-06-25 05:48:45.25", 38, 13, "20160625054845", "false"},
                                    {-1, -1, "2008-10-22 10:20:17.685", 38, 13, "20081022102017", "false"},
                                    {-1, -1, "2015-08-18 20:46:00.474", 38, 13, "20150818204600", "false"},
                                    {-1, -1, "2017-08-28 07:31:02.589", 38, 13, "20170828073102", "false"},
                                    {-1, -1, "2021-11-25 01:21:02.798", 38, 13, "20211125012102", "false"},
                                    {-1, -1, "2014-03-16 00:27:51.6", 38, 13, "20140316002751", "false"},
                                    {-1, -1, "2019-04-03 21:52:42.193", 38, 13, "20190403215242", "false"},
                                    {-1, -1, "2008-05-27 08:57:16.252", 38, 13, "20080527085716", "false"},
                                    {-1, -1, "2010-05-03 07:26:50.787", 38, 13, "20100503072650", "false"},
                                    {-1, -1, "2002-04-11 22:56:17.451", 38, 13, "20020411225617", "false"},
                                    {-1, -1, "2011-02-28 18:12:58.581", 38, 13, "20110228181258", "false"},
                                    {-1, -1, "2016-04-05 09:44:20.975", 38, 13, "20160405094420", "false"},
                                    {-1, -1, "2010-11-04 08:02:16.056", 38, 13, "20101104080216", "false"},
                                    {-1, -1, "2006-06-20 10:57:20.13", 38, 13, "20060620105720", "false"},
                                    {-1, -1, "2006-04-22 02:47:18.01", 38, 13, "20060422024718", "false"},
                                    {-1, -1, "2009-07-16 22:11:10.377", 38, 13, "20090716221110", "false"},
                                    {-1, -1, "2003-10-18 11:21:27.56", 38, 13, "20031018112127", "false"},
                                    {-1, -1, "2003-08-10 12:28:23.353", 38, 13, "20030810122823", "false"},
                                    {-1, -1, "2015-07-09 11:17:03.756", 38, 13, "20150709111703", "false"}};
    test_cast_all<TYPE_DATETIME, TYPE_DECIMAL128>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDatetimeToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "2011-03-27 15:31:08.022", 38, 18, "20110327153108", "false"},
                                    {-1, -1, "2019-12-15 13:47:33.948", 38, 18, "20191215134733", "false"},
                                    {-1, -1, "2011-12-29 01:48:13.529", 38, 18, "20111229014813", "false"},
                                    {-1, -1, "2018-08-22 04:29:08.915", 38, 18, "20180822042908", "false"},
                                    {-1, -1, "2007-09-05 00:51:07.527", 38, 18, "20070905005107", "false"},
                                    {-1, -1, "2004-08-28 15:58:25.039", 38, 18, "20040828155825", "false"},
                                    {-1, -1, "2007-05-16 14:42:05.697", 38, 18, "20070516144205", "false"},
                                    {-1, -1, "2010-04-30 16:05:58.203", 38, 18, "20100430160558", "false"},
                                    {-1, -1, "2003-06-23 13:26:23.356", 38, 18, "20030623132623", "false"},
                                    {-1, -1, "2009-11-06 11:25:00.935", 38, 18, "20091106112500", "false"},
                                    {-1, -1, "2018-10-29 02:04:16.52", 38, 18, "20181029020416", "false"},
                                    {-1, -1, "2015-08-21 19:38:12.174", 38, 18, "20150821193812", "false"},
                                    {-1, -1, "2018-05-09 15:34:09.512", 38, 18, "20180509153409", "false"},
                                    {-1, -1, "2017-01-03 11:17:15.645", 38, 18, "20170103111715", "false"},
                                    {-1, -1, "2003-02-27 15:15:19.33", 38, 18, "20030227151519", "false"},
                                    {-1, -1, "2004-02-18 08:33:42.415", 38, 18, "20040218083342", "false"},
                                    {-1, -1, "2004-05-12 03:30:17.203", 38, 18, "20040512033017", "false"},
                                    {-1, -1, "2006-03-08 22:01:04.683", 38, 18, "20060308220104", "false"},
                                    {-1, -1, "2004-06-19 22:01:31.326", 38, 18, "20040619220131", "false"},
                                    {-1, -1, "2009-01-20 18:25:36.925", 38, 18, "20090120182536", "false"}};
    test_cast_all<TYPE_DATETIME, TYPE_DECIMAL128>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDatetimeToDecimal128p35s30Abnormal) {
    CastTestCaseArray test_cases = {{-1, -1, "2017-07-15 19:17:20.777", 35, 30, "", "true"},
                                    {-1, -1, "2012-07-22 03:10:28.893", 35, 30, "", "true"},
                                    {-1, -1, "2008-02-08 07:27:30.529", 35, 30, "", "true"},
                                    {-1, -1, "2015-05-31 06:46:14.697", 35, 30, "", "true"},
                                    {-1, -1, "2003-11-20 22:22:08.666", 35, 30, "", "true"},
                                    {-1, -1, "2008-12-13 17:42:50.875", 35, 30, "", "true"},
                                    {-1, -1, "2004-01-10 23:08:55.258", 35, 30, "", "true"},
                                    {-1, -1, "2011-08-20 02:43:49.585", 35, 30, "", "true"},
                                    {-1, -1, "2017-11-28 01:40:38.191", 35, 30, "", "true"},
                                    {-1, -1, "2008-07-17 07:49:29.849", 35, 30, "", "true"},
                                    {-1, -1, "2009-07-11 23:45:40.551", 35, 30, "", "true"},
                                    {-1, -1, "2016-05-15 13:36:34.847", 35, 30, "", "true"},
                                    {-1, -1, "2012-03-31 12:07:55.486", 35, 30, "", "true"},
                                    {-1, -1, "2001-05-12 21:31:39.35", 35, 30, "", "true"},
                                    {-1, -1, "2020-11-15 05:54:27.748", 35, 30, "", "true"},
                                    {-1, -1, "2016-12-30 14:15:58.056", 35, 30, "", "true"},
                                    {-1, -1, "2016-05-28 04:24:41.363", 35, 30, "", "true"},
                                    {-1, -1, "2008-09-06 22:41:38.014", 35, 30, "", "true"},
                                    {-1, -1, "2002-11-18 12:54:01.371", 35, 30, "", "true"},
                                    {-1, -1, "2001-08-14 09:11:18.222", 35, 30, "", "true"}};
    test_cast_all_fail<TYPE_DATETIME, TYPE_DECIMAL128>(test_cases);
}
TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal32p9s0ToDateNormal) {
    CastTestCaseArray test_cases = {
            {9, 0, "19910916", -1, -1, "1991-09-16", "false"}, {9, 0, "19741120", -1, -1, "1974-11-20", "false"},
            {9, 0, "19950708", -1, -1, "1995-07-08", "false"}, {9, 0, "19910123", -1, -1, "1991-01-23", "false"},
            {9, 0, "19771025", -1, -1, "1977-10-25", "false"}, {9, 0, "19731216", -1, -1, "1973-12-16", "false"},
            {9, 0, "19751108", -1, -1, "1975-11-08", "false"}, {9, 0, "19871010", -1, -1, "1987-10-10", "false"},
            {9, 0, "19740603", -1, -1, "1974-06-03", "false"}, {9, 0, "19970721", -1, -1, "1997-07-21", "false"},
            {9, 0, "19740216", -1, -1, "1974-02-16", "false"}, {9, 0, "19800106", -1, -1, "1980-01-06", "false"},
            {9, 0, "19980107", -1, -1, "1998-01-07", "false"}, {9, 0, "19971202", -1, -1, "1997-12-02", "false"},
            {9, 0, "19970122", -1, -1, "1997-01-22", "false"}, {9, 0, "20010413", -1, -1, "2001-04-13", "false"},
            {9, 0, "19830709", -1, -1, "1983-07-09", "false"}, {9, 0, "19991218", -1, -1, "1999-12-18", "false"},
            {9, 0, "19860812", -1, -1, "1986-08-12", "false"}, {9, 0, "19790715", -1, -1, "1979-07-15", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DATE>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal64p11s2ToDateNormal) {
    CastTestCaseArray test_cases = {
            {11, 2, "19790512", -1, -1, "1979-05-12", "false"}, {11, 2, "19820528", -1, -1, "1982-05-28", "false"},
            {11, 2, "19871115", -1, -1, "1987-11-15", "false"}, {11, 2, "19760322", -1, -1, "1976-03-22", "false"},
            {11, 2, "19701109", -1, -1, "1970-11-09", "false"}, {11, 2, "19760705", -1, -1, "1976-07-05", "false"},
            {11, 2, "20000126", -1, -1, "2000-01-26", "false"}, {11, 2, "19840914", -1, -1, "1984-09-14", "false"},
            {11, 2, "19920309", -1, -1, "1992-03-09", "false"}, {11, 2, "19700626", -1, -1, "1970-06-26", "false"},
            {11, 2, "20010922", -1, -1, "2001-09-22", "false"}, {11, 2, "19940919", -1, -1, "1994-09-19", "false"},
            {11, 2, "19760125", -1, -1, "1976-01-25", "false"}, {11, 2, "19810811", -1, -1, "1981-08-11", "false"},
            {11, 2, "19970218", -1, -1, "1997-02-18", "false"}, {11, 2, "20010311", -1, -1, "2001-03-11", "false"},
            {11, 2, "19720720", -1, -1, "1972-07-20", "false"}, {11, 2, "19741217", -1, -1, "1974-12-17", "false"},
            {11, 2, "19870726", -1, -1, "1987-07-26", "false"}, {11, 2, "19770531", -1, -1, "1977-05-31", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DATE>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal32p9s9ToDateNormal) {
    CastTestCaseArray test_cases = {};
    test_cast_all<TYPE_DECIMAL32, TYPE_DATE>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal32p7s4ToDateNormal) {
    CastTestCaseArray test_cases = {};
    test_cast_all<TYPE_DECIMAL32, TYPE_DATE>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal64p18s0ToDateNormal) {
    CastTestCaseArray test_cases = {
            {18, 0, "19790911", -1, -1, "1979-09-11", "false"}, {18, 0, "19970807", -1, -1, "1997-08-07", "false"},
            {18, 0, "19850731", -1, -1, "1985-07-31", "false"}, {18, 0, "19901120", -1, -1, "1990-11-20", "false"},
            {18, 0, "19940121", -1, -1, "1994-01-21", "false"}, {18, 0, "19750530", -1, -1, "1975-05-30", "false"},
            {18, 0, "19910211", -1, -1, "1991-02-11", "false"}, {18, 0, "19701030", -1, -1, "1970-10-30", "false"},
            {18, 0, "19830113", -1, -1, "1983-01-13", "false"}, {18, 0, "19800526", -1, -1, "1980-05-26", "false"},
            {18, 0, "19810829", -1, -1, "1981-08-29", "false"}, {18, 0, "19870922", -1, -1, "1987-09-22", "false"},
            {18, 0, "19890218", -1, -1, "1989-02-18", "false"}, {18, 0, "19880310", -1, -1, "1988-03-10", "false"},
            {18, 0, "19860916", -1, -1, "1986-09-16", "false"}, {18, 0, "19970301", -1, -1, "1997-03-01", "false"},
            {18, 0, "19930315", -1, -1, "1993-03-15", "false"}, {18, 0, "19890513", -1, -1, "1989-05-13", "false"},
            {18, 0, "19850307", -1, -1, "1985-03-07", "false"}, {18, 0, "19800129", -1, -1, "1980-01-29", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DATE>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal64p18s2ToDateNormal) {
    CastTestCaseArray test_cases = {
            {18, 2, "19750215", -1, -1, "1975-02-15", "false"}, {18, 2, "19760412", -1, -1, "1976-04-12", "false"},
            {18, 2, "19830426", -1, -1, "1983-04-26", "false"}, {18, 2, "19850405", -1, -1, "1985-04-05", "false"},
            {18, 2, "19901016", -1, -1, "1990-10-16", "false"}, {18, 2, "19700222", -1, -1, "1970-02-22", "false"},
            {18, 2, "19741220", -1, -1, "1974-12-20", "false"}, {18, 2, "19880614", -1, -1, "1988-06-14", "false"},
            {18, 2, "19980303", -1, -1, "1998-03-03", "false"}, {18, 2, "19970103", -1, -1, "1997-01-03", "false"},
            {18, 2, "19880710", -1, -1, "1988-07-10", "false"}, {18, 2, "19700524", -1, -1, "1970-05-24", "false"},
            {18, 2, "19990915", -1, -1, "1999-09-15", "false"}, {18, 2, "19820905", -1, -1, "1982-09-05", "false"},
            {18, 2, "19950326", -1, -1, "1995-03-26", "false"}, {18, 2, "19840604", -1, -1, "1984-06-04", "false"},
            {18, 2, "19730728", -1, -1, "1973-07-28", "false"}, {18, 2, "19940222", -1, -1, "1994-02-22", "false"},
            {18, 2, "19801024", -1, -1, "1980-10-24", "false"}, {18, 2, "20000123", -1, -1, "2000-01-23", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DATE>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal64p18s9ToDateNormal) {
    CastTestCaseArray test_cases = {
            {18, 9, "19990923", -1, -1, "1999-09-23", "false"}, {18, 9, "20000810", -1, -1, "2000-08-10", "false"},
            {18, 9, "19731022", -1, -1, "1973-10-22", "false"}, {18, 9, "19741004", -1, -1, "1974-10-04", "false"},
            {18, 9, "19960214", -1, -1, "1996-02-14", "false"}, {18, 9, "19870427", -1, -1, "1987-04-27", "false"},
            {18, 9, "19811002", -1, -1, "1981-10-02", "false"}, {18, 9, "19870608", -1, -1, "1987-06-08", "false"},
            {18, 9, "19720503", -1, -1, "1972-05-03", "false"}, {18, 9, "20010118", -1, -1, "2001-01-18", "false"},
            {18, 9, "20000119", -1, -1, "2000-01-19", "false"}, {18, 9, "19911007", -1, -1, "1991-10-07", "false"},
            {18, 9, "19850618", -1, -1, "1985-06-18", "false"}, {18, 9, "19720429", -1, -1, "1972-04-29", "false"},
            {18, 9, "19931202", -1, -1, "1993-12-02", "false"}, {18, 9, "19820709", -1, -1, "1982-07-09", "false"},
            {18, 9, "19921224", -1, -1, "1992-12-24", "false"}, {18, 9, "19980206", -1, -1, "1998-02-06", "false"},
            {18, 9, "19780516", -1, -1, "1978-05-16", "false"}, {18, 9, "19700330", -1, -1, "1970-03-30", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DATE>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal64p18s18ToDateNormal) {
    CastTestCaseArray test_cases = {};
    test_cast_all<TYPE_DECIMAL64, TYPE_DATE>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal64p15s13ToDateNormal) {
    CastTestCaseArray test_cases = {};
    test_cast_all<TYPE_DECIMAL64, TYPE_DATE>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal128p38s0ToDateNormal) {
    CastTestCaseArray test_cases = {
            {38, 0, "19751226", -1, -1, "1975-12-26", "false"}, {38, 0, "19990203", -1, -1, "1999-02-03", "false"},
            {38, 0, "19911128", -1, -1, "1991-11-28", "false"}, {38, 0, "19971106", -1, -1, "1997-11-06", "false"},
            {38, 0, "19770924", -1, -1, "1977-09-24", "false"}, {38, 0, "19720721", -1, -1, "1972-07-21", "false"},
            {38, 0, "19980828", -1, -1, "1998-08-28", "false"}, {38, 0, "19910308", -1, -1, "1991-03-08", "false"},
            {38, 0, "19860718", -1, -1, "1986-07-18", "false"}, {38, 0, "19750911", -1, -1, "1975-09-11", "false"},
            {38, 0, "19730311", -1, -1, "1973-03-11", "false"}, {38, 0, "19911017", -1, -1, "1991-10-17", "false"},
            {38, 0, "19980330", -1, -1, "1998-03-30", "false"}, {38, 0, "19900506", -1, -1, "1990-05-06", "false"},
            {38, 0, "19900331", -1, -1, "1990-03-31", "false"}, {38, 0, "20000811", -1, -1, "2000-08-11", "false"},
            {38, 0, "19850616", -1, -1, "1985-06-16", "false"}, {38, 0, "19821105", -1, -1, "1982-11-05", "false"},
            {38, 0, "19980222", -1, -1, "1998-02-22", "false"}, {38, 0, "19910512", -1, -1, "1991-05-12", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DATE>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal128p38s2ToDateNormal) {
    CastTestCaseArray test_cases = {
            {38, 2, "19910528", -1, -1, "1991-05-28", "false"}, {38, 2, "19780211", -1, -1, "1978-02-11", "false"},
            {38, 2, "19780108", -1, -1, "1978-01-08", "false"}, {38, 2, "19830909", -1, -1, "1983-09-09", "false"},
            {38, 2, "19760502", -1, -1, "1976-05-02", "false"}, {38, 2, "19721019", -1, -1, "1972-10-19", "false"},
            {38, 2, "19970111", -1, -1, "1997-01-11", "false"}, {38, 2, "19770610", -1, -1, "1977-06-10", "false"},
            {38, 2, "19930215", -1, -1, "1993-02-15", "false"}, {38, 2, "19780830", -1, -1, "1978-08-30", "false"},
            {38, 2, "19890926", -1, -1, "1989-09-26", "false"}, {38, 2, "19910304", -1, -1, "1991-03-04", "false"},
            {38, 2, "19890803", -1, -1, "1989-08-03", "false"}, {38, 2, "19931119", -1, -1, "1993-11-19", "false"},
            {38, 2, "20001204", -1, -1, "2000-12-04", "false"}, {38, 2, "19790115", -1, -1, "1979-01-15", "false"},
            {38, 2, "19791003", -1, -1, "1979-10-03", "false"}, {38, 2, "19720708", -1, -1, "1972-07-08", "false"},
            {38, 2, "19780326", -1, -1, "1978-03-26", "false"}, {38, 2, "19790509", -1, -1, "1979-05-09", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DATE>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal128p38s9ToDateNormal) {
    CastTestCaseArray test_cases = {
            {38, 9, "19741215", -1, -1, "1974-12-15", "false"}, {38, 9, "19880708", -1, -1, "1988-07-08", "false"},
            {38, 9, "19920131", -1, -1, "1992-01-31", "false"}, {38, 9, "19951014", -1, -1, "1995-10-14", "false"},
            {38, 9, "19720812", -1, -1, "1972-08-12", "false"}, {38, 9, "19960412", -1, -1, "1996-04-12", "false"},
            {38, 9, "19730508", -1, -1, "1973-05-08", "false"}, {38, 9, "19800306", -1, -1, "1980-03-06", "false"},
            {38, 9, "19931127", -1, -1, "1993-11-27", "false"}, {38, 9, "19700726", -1, -1, "1970-07-26", "false"},
            {38, 9, "19740529", -1, -1, "1974-05-29", "false"}, {38, 9, "19701213", -1, -1, "1970-12-13", "false"},
            {38, 9, "19820426", -1, -1, "1982-04-26", "false"}, {38, 9, "19900124", -1, -1, "1990-01-24", "false"},
            {38, 9, "19780130", -1, -1, "1978-01-30", "false"}, {38, 9, "19870411", -1, -1, "1987-04-11", "false"},
            {38, 9, "19740501", -1, -1, "1974-05-01", "false"}, {38, 9, "19960604", -1, -1, "1996-06-04", "false"},
            {38, 9, "19840531", -1, -1, "1984-05-31", "false"}, {38, 9, "19870615", -1, -1, "1987-06-15", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DATE>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal128p38s13ToDateNormal) {
    CastTestCaseArray test_cases = {
            {38, 13, "19941007", -1, -1, "1994-10-07", "false"}, {38, 13, "19940505", -1, -1, "1994-05-05", "false"},
            {38, 13, "19770619", -1, -1, "1977-06-19", "false"}, {38, 13, "19701008", -1, -1, "1970-10-08", "false"},
            {38, 13, "20000501", -1, -1, "2000-05-01", "false"}, {38, 13, "19720814", -1, -1, "1972-08-14", "false"},
            {38, 13, "19920713", -1, -1, "1992-07-13", "false"}, {38, 13, "19890131", -1, -1, "1989-01-31", "false"},
            {38, 13, "19990930", -1, -1, "1999-09-30", "false"}, {38, 13, "19740425", -1, -1, "1974-04-25", "false"},
            {38, 13, "19720107", -1, -1, "1972-01-07", "false"}, {38, 13, "19850605", -1, -1, "1985-06-05", "false"},
            {38, 13, "19930701", -1, -1, "1993-07-01", "false"}, {38, 13, "19911218", -1, -1, "1991-12-18", "false"},
            {38, 13, "19961108", -1, -1, "1996-11-08", "false"}, {38, 13, "19891212", -1, -1, "1989-12-12", "false"},
            {38, 13, "19730827", -1, -1, "1973-08-27", "false"}, {38, 13, "19840910", -1, -1, "1984-09-10", "false"},
            {38, 13, "19730112", -1, -1, "1973-01-12", "false"}, {38, 13, "19951010", -1, -1, "1995-10-10", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DATE>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal128p38s18ToDateNormal) {
    CastTestCaseArray test_cases = {
            {38, 18, "19880427", -1, -1, "1988-04-27", "false"}, {38, 18, "19770108", -1, -1, "1977-01-08", "false"},
            {38, 18, "19921002", -1, -1, "1992-10-02", "false"}, {38, 18, "19720419", -1, -1, "1972-04-19", "false"},
            {38, 18, "19900430", -1, -1, "1990-04-30", "false"}, {38, 18, "19720124", -1, -1, "1972-01-24", "false"},
            {38, 18, "19870921", -1, -1, "1987-09-21", "false"}, {38, 18, "19831024", -1, -1, "1983-10-24", "false"},
            {38, 18, "20010205", -1, -1, "2001-02-05", "false"}, {38, 18, "19971203", -1, -1, "1997-12-03", "false"},
            {38, 18, "19811019", -1, -1, "1981-10-19", "false"}, {38, 18, "19710405", -1, -1, "1971-04-05", "false"},
            {38, 18, "19820502", -1, -1, "1982-05-02", "false"}, {38, 18, "19970720", -1, -1, "1997-07-20", "false"},
            {38, 18, "19880128", -1, -1, "1988-01-28", "false"}, {38, 18, "19740302", -1, -1, "1974-03-02", "false"},
            {38, 18, "19831220", -1, -1, "1983-12-20", "false"}, {38, 18, "19870406", -1, -1, "1987-04-06", "false"},
            {38, 18, "19960818", -1, -1, "1996-08-18", "false"}, {38, 18, "19961025", -1, -1, "1996-10-25", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DATE>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal128p35s30ToDateNormal) {
    CastTestCaseArray test_cases = {
            {35, 30, "19991230", -1, -1, "1999-12-30", "false"}, {35, 30, "19830818", -1, -1, "1983-08-18", "false"},
            {35, 30, "19901227", -1, -1, "1990-12-27", "false"}, {35, 30, "19821101", -1, -1, "1982-11-01", "false"},
            {35, 30, "19860625", -1, -1, "1986-06-25", "false"}, {35, 30, "19750322", -1, -1, "1975-03-22", "false"},
            {35, 30, "19950322", -1, -1, "1995-03-22", "false"}, {35, 30, "19900407", -1, -1, "1990-04-07", "false"},
            {35, 30, "19960218", -1, -1, "1996-02-18", "false"}, {35, 30, "20000127", -1, -1, "2000-01-27", "false"},
            {35, 30, "19930605", -1, -1, "1993-06-05", "false"}, {35, 30, "19740131", -1, -1, "1974-01-31", "false"},
            {35, 30, "19900413", -1, -1, "1990-04-13", "false"}, {35, 30, "19750206", -1, -1, "1975-02-06", "false"},
            {35, 30, "19710118", -1, -1, "1971-01-18", "false"}, {35, 30, "19960101", -1, -1, "1996-01-01", "false"},
            {35, 30, "19700318", -1, -1, "1970-03-18", "false"}, {35, 30, "19980408", -1, -1, "1998-04-08", "false"},
            {35, 30, "20001205", -1, -1, "2000-12-05", "false"}, {35, 30, "19710128", -1, -1, "1971-01-28", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DATE>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal32p9s0ToDatetimeNormal) {
    CastTestCaseArray test_cases = {};
    test_cast_all<TYPE_DECIMAL32, TYPE_DATETIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal32p9s2ToDatetimeNormal) {
    CastTestCaseArray test_cases = {};
    test_cast_all<TYPE_DECIMAL32, TYPE_DATETIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal32p9s9ToDatetimeNormal) {
    CastTestCaseArray test_cases = {};
    test_cast_all<TYPE_DECIMAL32, TYPE_DATETIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal32p7s4ToDatetimeNormal) {
    CastTestCaseArray test_cases = {};
    test_cast_all<TYPE_DECIMAL32, TYPE_DATETIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal64p18s0ToDatetimeNormal) {
    CastTestCaseArray test_cases = {{18, 0, "20071221062829", -1, -1, "2007-12-21 06:28:29", "false"},
                                    {18, 0, "20150220234805", -1, -1, "2015-02-20 23:48:05", "false"},
                                    {18, 0, "20041215072801", -1, -1, "2004-12-15 07:28:01", "false"},
                                    {18, 0, "20080716210606", -1, -1, "2008-07-16 21:06:06", "false"},
                                    {18, 0, "20030201090400", -1, -1, "2003-02-01 09:04:00", "false"},
                                    {18, 0, "20160122080942", -1, -1, "2016-01-22 08:09:42", "false"},
                                    {18, 0, "20190516085145", -1, -1, "2019-05-16 08:51:45", "false"},
                                    {18, 0, "20180801184346", -1, -1, "2018-08-01 18:43:46", "false"},
                                    {18, 0, "20200924015015", -1, -1, "2020-09-24 01:50:15", "false"},
                                    {18, 0, "20161211050839", -1, -1, "2016-12-11 05:08:39", "false"},
                                    {18, 0, "20110129004131", -1, -1, "2011-01-29 00:41:31", "false"},
                                    {18, 0, "20101023004917", -1, -1, "2010-10-23 00:49:17", "false"},
                                    {18, 0, "20191214173243", -1, -1, "2019-12-14 17:32:43", "false"},
                                    {18, 0, "20141218034713", -1, -1, "2014-12-18 03:47:13", "false"},
                                    {18, 0, "20180410210527", -1, -1, "2018-04-10 21:05:27", "false"},
                                    {18, 0, "20040524235434", -1, -1, "2004-05-24 23:54:34", "false"},
                                    {18, 0, "20190911092414", -1, -1, "2019-09-11 09:24:14", "false"},
                                    {18, 0, "20010707183939", -1, -1, "2001-07-07 18:39:39", "false"},
                                    {18, 0, "20161202113101", -1, -1, "2016-12-02 11:31:01", "false"},
                                    {18, 0, "20190330004054", -1, -1, "2019-03-30 00:40:54", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DATETIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal64p18s2ToDatetimeNormal) {
    CastTestCaseArray test_cases = {{18, 2, "20040129182250", -1, -1, "2004-01-29 18:22:50", "false"},
                                    {18, 2, "20040406215926", -1, -1, "2004-04-06 21:59:26", "false"},
                                    {18, 2, "20110716134343", -1, -1, "2011-07-16 13:43:43", "false"},
                                    {18, 2, "20060418125209", -1, -1, "2006-04-18 12:52:09", "false"},
                                    {18, 2, "20170405231253", -1, -1, "2017-04-05 23:12:53", "false"},
                                    {18, 2, "20180328100325", -1, -1, "2018-03-28 10:03:25", "false"},
                                    {18, 2, "20190315112947", -1, -1, "2019-03-15 11:29:47", "false"},
                                    {18, 2, "20081215190022", -1, -1, "2008-12-15 19:00:22", "false"},
                                    {18, 2, "20171020041139", -1, -1, "2017-10-20 04:11:39", "false"},
                                    {18, 2, "20210928175413", -1, -1, "2021-09-28 17:54:13", "false"},
                                    {18, 2, "20131103072821", -1, -1, "2013-11-03 07:28:21", "false"},
                                    {18, 2, "20150902111152", -1, -1, "2015-09-02 11:11:52", "false"},
                                    {18, 2, "20171003080637", -1, -1, "2017-10-03 08:06:37", "false"},
                                    {18, 2, "20210321140206", -1, -1, "2021-03-21 14:02:06", "false"},
                                    {18, 2, "20091211045632", -1, -1, "2009-12-11 04:56:32", "false"},
                                    {18, 2, "20201217162541", -1, -1, "2020-12-17 16:25:41", "false"},
                                    {18, 2, "20190711200114", -1, -1, "2019-07-11 20:01:14", "false"},
                                    {18, 2, "20020313021152", -1, -1, "2002-03-13 02:11:52", "false"},
                                    {18, 2, "20170221044902", -1, -1, "2017-02-21 04:49:02", "false"},
                                    {18, 2, "20100212174432", -1, -1, "2010-02-12 17:44:32", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DATETIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal64p18s9ToDatetimeNormal) {
    CastTestCaseArray test_cases = {};
    test_cast_all<TYPE_DECIMAL64, TYPE_DATETIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal64p18s18ToDatetimeNormal) {
    CastTestCaseArray test_cases = {};
    test_cast_all<TYPE_DECIMAL64, TYPE_DATETIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal64p15s13ToDatetimeNormal) {
    CastTestCaseArray test_cases = {};
    test_cast_all<TYPE_DECIMAL64, TYPE_DATETIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal128p38s0ToDatetimeNormal) {
    CastTestCaseArray test_cases = {{38, 0, "20100810044805", -1, -1, "2010-08-10 04:48:05", "false"},
                                    {38, 0, "20170809074442", -1, -1, "2017-08-09 07:44:42", "false"},
                                    {38, 0, "20160621063947", -1, -1, "2016-06-21 06:39:47", "false"},
                                    {38, 0, "20100307153641", -1, -1, "2010-03-07 15:36:41", "false"},
                                    {38, 0, "20060826224852", -1, -1, "2006-08-26 22:48:52", "false"},
                                    {38, 0, "20100426114133", -1, -1, "2010-04-26 11:41:33", "false"},
                                    {38, 0, "20200930042519", -1, -1, "2020-09-30 04:25:19", "false"},
                                    {38, 0, "20150317093135", -1, -1, "2015-03-17 09:31:35", "false"},
                                    {38, 0, "20170118232920", -1, -1, "2017-01-18 23:29:20", "false"},
                                    {38, 0, "20161228205346", -1, -1, "2016-12-28 20:53:46", "false"},
                                    {38, 0, "20200927005854", -1, -1, "2020-09-27 00:58:54", "false"},
                                    {38, 0, "20121221035235", -1, -1, "2012-12-21 03:52:35", "false"},
                                    {38, 0, "20131111221202", -1, -1, "2013-11-11 22:12:02", "false"},
                                    {38, 0, "20071010105611", -1, -1, "2007-10-10 10:56:11", "false"},
                                    {38, 0, "20120819052237", -1, -1, "2012-08-19 05:22:37", "false"},
                                    {38, 0, "20180220063955", -1, -1, "2018-02-20 06:39:55", "false"},
                                    {38, 0, "20031224031258", -1, -1, "2003-12-24 03:12:58", "false"},
                                    {38, 0, "20180724002032", -1, -1, "2018-07-24 00:20:32", "false"},
                                    {38, 0, "20210612004039", -1, -1, "2021-06-12 00:40:39", "false"},
                                    {38, 0, "20041122212626", -1, -1, "2004-11-22 21:26:26", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DATETIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal128p38s2ToDatetimeNormal) {
    CastTestCaseArray test_cases = {{38, 2, "20050728172401", -1, -1, "2005-07-28 17:24:01", "false"},
                                    {38, 2, "20030929130234", -1, -1, "2003-09-29 13:02:34", "false"},
                                    {38, 2, "20130419162650", -1, -1, "2013-04-19 16:26:50", "false"},
                                    {38, 2, "20210807141249", -1, -1, "2021-08-07 14:12:49", "false"},
                                    {38, 2, "20120730074843", -1, -1, "2012-07-30 07:48:43", "false"},
                                    {38, 2, "20150925060956", -1, -1, "2015-09-25 06:09:56", "false"},
                                    {38, 2, "20090915023039", -1, -1, "2009-09-15 02:30:39", "false"},
                                    {38, 2, "20161117123631", -1, -1, "2016-11-17 12:36:31", "false"},
                                    {38, 2, "20070726044922", -1, -1, "2007-07-26 04:49:22", "false"},
                                    {38, 2, "20120723221338", -1, -1, "2012-07-23 22:13:38", "false"},
                                    {38, 2, "20090706021931", -1, -1, "2009-07-06 02:19:31", "false"},
                                    {38, 2, "20190520122251", -1, -1, "2019-05-20 12:22:51", "false"},
                                    {38, 2, "20210418044824", -1, -1, "2021-04-18 04:48:24", "false"},
                                    {38, 2, "20030212041506", -1, -1, "2003-02-12 04:15:06", "false"},
                                    {38, 2, "20081217180327", -1, -1, "2008-12-17 18:03:27", "false"},
                                    {38, 2, "20080819103946", -1, -1, "2008-08-19 10:39:46", "false"},
                                    {38, 2, "20121013160521", -1, -1, "2012-10-13 16:05:21", "false"},
                                    {38, 2, "20070604212655", -1, -1, "2007-06-04 21:26:55", "false"},
                                    {38, 2, "20100120164912", -1, -1, "2010-01-20 16:49:12", "false"},
                                    {38, 2, "20130703235727", -1, -1, "2013-07-03 23:57:27", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DATETIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal128p38s9ToDatetimeNormal) {
    CastTestCaseArray test_cases = {{38, 9, "20200412032750", -1, -1, "2020-04-12 03:27:50", "false"},
                                    {38, 9, "20130813002224", -1, -1, "2013-08-13 00:22:24", "false"},
                                    {38, 9, "20180119090549", -1, -1, "2018-01-19 09:05:49", "false"},
                                    {38, 9, "20191117164426", -1, -1, "2019-11-17 16:44:26", "false"},
                                    {38, 9, "20050212220742", -1, -1, "2005-02-12 22:07:42", "false"},
                                    {38, 9, "20180901165514", -1, -1, "2018-09-01 16:55:14", "false"},
                                    {38, 9, "20150720055357", -1, -1, "2015-07-20 05:53:57", "false"},
                                    {38, 9, "20010406032631", -1, -1, "2001-04-06 03:26:31", "false"},
                                    {38, 9, "20050222001516", -1, -1, "2005-02-22 00:15:16", "false"},
                                    {38, 9, "20010704014613", -1, -1, "2001-07-04 01:46:13", "false"},
                                    {38, 9, "20181114202906", -1, -1, "2018-11-14 20:29:06", "false"},
                                    {38, 9, "20180406145626", -1, -1, "2018-04-06 14:56:26", "false"},
                                    {38, 9, "20080619200910", -1, -1, "2008-06-19 20:09:10", "false"},
                                    {38, 9, "20190926015732", -1, -1, "2019-09-26 01:57:32", "false"},
                                    {38, 9, "20160801145420", -1, -1, "2016-08-01 14:54:20", "false"},
                                    {38, 9, "20100717073751", -1, -1, "2010-07-17 07:37:51", "false"},
                                    {38, 9, "20071113090527", -1, -1, "2007-11-13 09:05:27", "false"},
                                    {38, 9, "20110310061227", -1, -1, "2011-03-10 06:12:27", "false"},
                                    {38, 9, "20060715035754", -1, -1, "2006-07-15 03:57:54", "false"},
                                    {38, 9, "20210416210603", -1, -1, "2021-04-16 21:06:03", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DATETIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal128p38s13ToDatetimeNormal) {
    CastTestCaseArray test_cases = {{38, 13, "20110204092502", -1, -1, "2011-02-04 09:25:02", "false"},
                                    {38, 13, "20170125065753", -1, -1, "2017-01-25 06:57:53", "false"},
                                    {38, 13, "20171031063510", -1, -1, "2017-10-31 06:35:10", "false"},
                                    {38, 13, "20061010234421", -1, -1, "2006-10-10 23:44:21", "false"},
                                    {38, 13, "20180117101033", -1, -1, "2018-01-17 10:10:33", "false"},
                                    {38, 13, "20161005235633", -1, -1, "2016-10-05 23:56:33", "false"},
                                    {38, 13, "20080318183047", -1, -1, "2008-03-18 18:30:47", "false"},
                                    {38, 13, "20040308011402", -1, -1, "2004-03-08 01:14:02", "false"},
                                    {38, 13, "20021222101310", -1, -1, "2002-12-22 10:13:10", "false"},
                                    {38, 13, "20020809091224", -1, -1, "2002-08-09 09:12:24", "false"},
                                    {38, 13, "20200114150158", -1, -1, "2020-01-14 15:01:58", "false"},
                                    {38, 13, "20110131190009", -1, -1, "2011-01-31 19:00:09", "false"},
                                    {38, 13, "20120428162239", -1, -1, "2012-04-28 16:22:39", "false"},
                                    {38, 13, "20041130034755", -1, -1, "2004-11-30 03:47:55", "false"},
                                    {38, 13, "20180409213551", -1, -1, "2018-04-09 21:35:51", "false"},
                                    {38, 13, "20141212071753", -1, -1, "2014-12-12 07:17:53", "false"},
                                    {38, 13, "20021208095614", -1, -1, "2002-12-08 09:56:14", "false"},
                                    {38, 13, "20200511114551", -1, -1, "2020-05-11 11:45:51", "false"},
                                    {38, 13, "20130606093644", -1, -1, "2013-06-06 09:36:44", "false"},
                                    {38, 13, "20131127064218", -1, -1, "2013-11-27 06:42:18", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DATETIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal128p38s18ToDatetimeNormal) {
    CastTestCaseArray test_cases = {{38, 18, "20161201205946", -1, -1, "2016-12-01 20:59:46", "false"},
                                    {38, 18, "20110206071013", -1, -1, "2011-02-06 07:10:13", "false"},
                                    {38, 18, "20211124013622", -1, -1, "2021-11-24 01:36:22", "false"},
                                    {38, 18, "20061010171709", -1, -1, "2006-10-10 17:17:09", "false"},
                                    {38, 18, "20120714162039", -1, -1, "2012-07-14 16:20:39", "false"},
                                    {38, 18, "20180118182748", -1, -1, "2018-01-18 18:27:48", "false"},
                                    {38, 18, "20130402224929", -1, -1, "2013-04-02 22:49:29", "false"},
                                    {38, 18, "20080306143853", -1, -1, "2008-03-06 14:38:53", "false"},
                                    {38, 18, "20140716104132", -1, -1, "2014-07-16 10:41:32", "false"},
                                    {38, 18, "20111127190218", -1, -1, "2011-11-27 19:02:18", "false"},
                                    {38, 18, "20211227012447", -1, -1, "2021-12-27 01:24:47", "false"},
                                    {38, 18, "20210404161546", -1, -1, "2021-04-04 16:15:46", "false"},
                                    {38, 18, "20071021140353", -1, -1, "2007-10-21 14:03:53", "false"},
                                    {38, 18, "20050804215052", -1, -1, "2005-08-04 21:50:52", "false"},
                                    {38, 18, "20141013204000", -1, -1, "2014-10-13 20:40:00", "false"},
                                    {38, 18, "20051111013441", -1, -1, "2005-11-11 01:34:41", "false"},
                                    {38, 18, "20180411214200", -1, -1, "2018-04-11 21:42:00", "false"},
                                    {38, 18, "20110624111405", -1, -1, "2011-06-24 11:14:05", "false"},
                                    {38, 18, "20100128112856", -1, -1, "2010-01-28 11:28:56", "false"},
                                    {38, 18, "20211102221107", -1, -1, "2021-11-02 22:11:07", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DATETIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal128p35s30ToDatetimeNormal) {
    CastTestCaseArray test_cases = {};
    test_cast_all<TYPE_DECIMAL128, TYPE_DATETIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal128p38s18TotimeNormal) {
    CastTestCaseArray test_cases = {{38, 18, "232", -1, -1, "00:02:32", "false"},
                                    {38, 18, "5959", -1, -1, "00:59:59", "false"},
                                    {38, 18, "365613", -1, -1, "36:56:13", "false"},
                                    {38, 18, "20120714162039", -1, -1, "2012071416:20:39", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_TIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDecimal128p38s18TotimeNullNormal) {
    CastTestCaseArray test_cases = {{38, 18, "122378", -1, -1, "", "true"},
                                    {38, 18, "20120714166039", -1, -1, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_TIME>(test_cases);
}

TEST_F(VectorizedDecimalCastExprTimeTest, testCastFromDatetimeToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {{-1, -1, "232", 9, 0, "352", "false"},
                                    {-1, -1, "6060", 9, 0, "14100", "false"},
                                    {-1, -1, "365613", 9, 0, "1013333", "false"},
                                    {-1, -1, "20120714162039", 9, 0, "55890872671359", "false"}};
    test_cast_all_fail<TYPE_TIME, TYPE_DECIMAL32>(test_cases);
}
} // namespace starrocks::vectorized
